{{extend 'layout.html'}}
<h1>Groups</h1>
<br>
Create a group:
{{=form2}}
<br>
Delete a group:
<br>
{{for group in allGroups:}}
{{=group.role}}<a href="{{=URL('deleteGroup', args=group.id)}}">[delete]</a>
<br>
{{pass}}
<br>
<br>
<h1>Memberships</h1>
<br>
Assign membership:
{{=form1}}
<br>
Remove membership:
<br>
{{for membership in allMemberships:}}
{{user = db(db.auth_user.id==membership.user_id).select().first()}}
{{=user.first_name}} {{=user.last_name}} (<a href="mailto:{{=user.email}}">{{=user.email}}</a>) in group: {{=db(db.auth_group.id==membership.group_id).select().first().role}}<a href="{{=URL('deleteMembership', args=membership.id)}}">[remove]</a>
<br>
{{pass}}